<!DOCTYPE html>












  


<html class="theme-next gemini use-motion" lang="zh-CN">
<head><meta name="generator" content="Hexo 3.9.0">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">












  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon-32x32-next.png?v=7.2.0">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16-next.png?v=7.2.0">


  <link rel="mask-icon" href="/images/logo.svg?v=7.2.0" color="#222">






<link rel="stylesheet" href="/css/main.css?v=7.2.0">






<link rel="stylesheet" href="/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">








<script id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Gemini',
    version: '7.2.0',
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":false},
    copycode: {"enable":false,"show_result":false,"style":null},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":false,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    search: {
      root: '/',
      path: ''
    },
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    }
  };
</script>

  <meta name="description" content="&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;读初中时，英语课本里有一对儿明星CP李雷和韩梅梅经常跳出来考我们的听力水平，对他们是既爱又恨。在暗号界也有一对儿明星：Alice和Bob，不过他俩可没空跳出来难为学生娃们，他俩有更重要的事情，总是忙着应用各种办法提防第三者Eve、Mallory等破坏他们的联系。关于他俩的传说有很多很多。&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;他俩都是70后，">
<meta name="keywords" content="BLE">
<meta property="og:type" content="article">
<meta property="og:title" content="Alice和Bob">
<meta property="og:url" content="http://yoursite.com/2021/05/09/AliceBobCouple/index.html">
<meta property="og:site_name" content="Wen Wu&#39;s notes">
<meta property="og:description" content="&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;读初中时，英语课本里有一对儿明星CP李雷和韩梅梅经常跳出来考我们的听力水平，对他们是既爱又恨。在暗号界也有一对儿明星：Alice和Bob，不过他俩可没空跳出来难为学生娃们，他俩有更重要的事情，总是忙着应用各种办法提防第三者Eve、Mallory等破坏他们的联系。关于他俩的传说有很多很多。&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;他俩都是70后，">
<meta property="og:locale" content="zh-CN">
<meta property="og:image" content="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BLE/AliceAndBob_0.png">
<meta property="og:image" content="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BLE/Diffie-Hellman.png">
<meta property="og:updated_time" content="2021-07-30T23:56:08.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Alice和Bob">
<meta name="twitter:description" content="&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;读初中时，英语课本里有一对儿明星CP李雷和韩梅梅经常跳出来考我们的听力水平，对他们是既爱又恨。在暗号界也有一对儿明星：Alice和Bob，不过他俩可没空跳出来难为学生娃们，他俩有更重要的事情，总是忙着应用各种办法提防第三者Eve、Mallory等破坏他们的联系。关于他俩的传说有很多很多。&amp;emsp;&amp;emsp;&amp;emsp;&amp;emsp;他俩都是70后，">
<meta name="twitter:image" content="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BLE/AliceAndBob_0.png">





  
  
  <link rel="canonical" href="http://yoursite.com/2021/05/09/AliceBobCouple/">



<script id="page.configurations">
  CONFIG.page = {
    sidebar: "",
  };
</script>

  
  <title>Alice和Bob | Wen Wu's notes</title>
  












  <noscript>
  <style>
  .use-motion .motion-element,
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-title { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">

  
  
    
  

  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">Wen Wu's notes</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
    
      
        <p class="site-subtitle">technical record</p>
      
    
    
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>



<nav class="site-nav">
  
    <ul id="menu" class="menu">
      
        
        
        
          
          <li class="menu-item menu-item-home">

    
    
      
    

    

    <a href="/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-about">

    
    
      
    

    

    <a href="/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-tags">

    
    
      
    

    

    <a href="/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-categories">

    
    
      
    

    

    <a href="/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-archives">

    
    
      
    

    

    <a href="/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-schedule">

    
    
      
    

    

    <a href="/schedule/" rel="section"><i class="menu-item-icon fa fa-fw fa-calendar"></i> <br>日程表</a>

  </li>
        
        
        
          
          <li class="menu-item menu-item-sitemap">

    
    
      
    

    

    <a href="/sitemap.xml" rel="section"><i class="menu-item-icon fa fa-fw fa-sitemap"></i> <br>站点地图</a>

  </li>

      
      
    </ul>
  

  

  
</nav>



</div>
    </header>

    


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          
            

          
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      

  
  
  

  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2021/05/09/AliceBobCouple/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="Wen Wu">
      <meta itemprop="description" content="I'm a bluetooth Host and Controller developer">
      <meta itemprop="image" content="/images/avatar.gif">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="Wen Wu's notes">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Alice和Bob

              
            
          </h1>
        

        <div class="post-meta">

          
          
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              

              
                
              

              <time title="创建时间：2021-05-09 07:56:08" itemprop="dateCreated datePublished" datetime="2021-05-09T07:56:08+08:00">2021-05-09</time>
            </span>
          

          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                
                  <span class="post-meta-item-text">更新于</span>
                
                <time title="修改时间：2021-07-31 07:56:08" itemprop="dateModified" datetime="2021-07-31T07:56:08+08:00">2021-07-31</time>
              </span>
            
          

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/categories/Bluetooth/" itemprop="url" rel="index"><span itemprop="name">Bluetooth</span></a></span>

                
                
              
            </span>
          

          
          
            <span id="/2021/05/09/AliceBobCouple/" class="post-meta-item leancloud_visitors" data-flag-title="Alice和Bob">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              
                <span class="post-meta-item-text">阅读次数：</span>
              
                <span class="leancloud-visitors-count"></span>
            </span>
          

          

          
            
  
  <span class="post-meta-item">
    
    <span class="post-meta-item-icon">
      <i class="fa fa-comment-o"></i>
    </span>
    
      <span class="post-meta-item-text">评论数：</span>
    
  
    <a href="/2021/05/09/AliceBobCouple/#comments" itemprop="discussionUrl">
      <span class="post-comments-count valine-comment-count" data-xid="/2021/05/09/AliceBobCouple/" itemprop="commentCount"></span>
    </a>
  </span>
  
  
          

          <br>
          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>&emsp;&emsp;&emsp;&emsp;读初中时，英语课本里有一对儿明星CP<a href="https://baike.baidu.com/item/李雷和韩梅梅/19455400?fr=aladdin">李雷和韩梅梅</a>经常跳出来考我们的听力水平，对他们是既爱又恨。在暗号界也有一对儿明星：Alice和Bob，不过他俩可没空跳出来难为学生娃们，他俩有更重要的事情，总是忙着应用各种办法提防第三者Eve、Mallory等破坏他们的联系。关于他俩的传说有很多很多。<br><img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BLE/AliceAndBob_0.png" alt><br>&emsp;&emsp;&emsp;&emsp;他俩都是70后，都生于<a href="http://cryptocouple.com/#nonsecret">1978</a>年。<br>&emsp;&emsp;&emsp;&emsp;两人早早结婚，<a href="https://en.wikipedia.org/wiki/Alice_and_Bob">1983年离婚</a>（时间线有点离谱），他俩不待见对方不见面，但还在一起做生意，不得不经常打打电话发发信息，还有些资金上的往来。有另外两个恨角儿Eve和Mollary多年来一直盯着他俩。Eve生于1988年，喜好偷听（eavesdropper），Mallory出生年月不详，专搞损人又利己的事儿：破坏、篡改Alice和Bob的通信信息或偷梁换柱骗取Alice和Bob的钱财（the man-in-the-middle attacker with malicious intent）。</p>
<blockquote>
<p> Although Alice and Bob were invented with no reference to their personality, authors soon began adding colorful descriptions. In 1983, Blum invented a backstory about a troubled relationship between Alice and Bob, writing, “Alice and Bob, recently divorced, mutually distrustful, still do business together. They live on opposite coasts, communicate mainly by telephone, and use their computers to transact business over the telephone.”[8] In 1984, John Gordon delivered his famous[9] “After Dinner Speech” about Alice and Bob, which he imagines to be the first “definitive biography of Alice and Bob.”</p>
</blockquote>
<p>&emsp;  也有<a href="https://urbigenous.net/library/alicebob.html">传说</a>Bob是股票经纪人（stockholder），Alice经常跟Bob买股票，是投机者（speculator），她自己的财务状况不想被她husband知道。而且Alice和Bob经常讨论的话题是如何逃税（Tax Fraud）等不法行为，所以他俩的讨论也不想让其他人知道，比如Tax Authority，Secret Police等等，有这么厉害的对手，是难上加难，但是Alice不这么认为，她的粉丝们也不不这么认为。<br>&emsp;  暗号界的粉丝及英雄们为了保证这对明星的联络正常，可谓绞尽脑汁、前赴后继。这些英雄中最为耀眼的当属 Whitfield Diffie和 Martin Hellman两位大师，他俩在1976年联合发明了不用交换加密的密钥也能正常加密解密的数学方法(Diffie–Hellman key exchange)，在将近30年后，他俩获得了2015年度的“图灵奖”—计算机科学界的最高荣耀。<br>  <img src="https://wnnwoo.oss-cn-chengdu.aliyuncs.com/BLE/Diffie-Hellman.png" alt><br>&emsp;  为了获得被Alice和Bob翻牌Bluetooth的机会，Blueooth SIG也忙前忙后的为他们定义了蓝牙数据的加密规范<a href="https://www.bluetooth.com/specifications/specs/core-specification/">Security Manager Specification</a>。<br>&emsp; </p>
<p>关于BLE 配对及机密机制，下面一篇大牛JDH的文章写的非常详尽。<br><a href="http://jdhblog.com/2019/05/14/BLE安全机制从入门到放弃">BLE安全机制从入门到放弃</a>  </p>
<p><strong>参考文献</strong><br>[1] <a href="http://cryptocouple.com/#nonsecret">A History of The World’s Most Famous Cryptographic Couple</a><br>[2] <a href="https://en.wikipedia.org/wiki/Alice_and_Bob">Alice_and_Bob</a><br>[3] <a href="https://www.americanscientist.org/article/alice-and-bob-in-cipherspace">Alice and Bob in Cipherspace</a><br>[5] <a href="https://link.springer.com/chapter/10.1007/978-3-642-36213-2_23">Alice and Bob in Love</a><br>[6] <a href="https://urbigenous.net/library/alicebob.html">The Alice and Bob After Dinner Speech</a><br>[7] <a href="https://www.bluetooth.com/specifications/specs/core-specification/">Bluetooth Core Spec 5.2</a><br>[8] <a href="https://www.ietf.org/rfc/rfc4493.txt">The AES-CMAC Algorithm</a></p>

      
    </div>

    

    
      
    

    
    
    

    

    
      
    
    

    

    <footer class="post-footer">
      
        
          
        
        <div class="post-tags">
          
            <a href="/tags/BLE/" rel="tag"># BLE</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2021/05/03/mynewt-install/" rel="next" title="mynewt（一） 环境配置">
                <i class="fa fa-chevron-left"></i> mynewt（一） 环境配置
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2021/06/09/EatList/" rel="prev" title="吃货的鄙视链">
                吃货的鄙视链 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>

  </div>


          </div>
          
  
    
    <div class="comments" id="comments"></div>
  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      

      <div class="site-overview-wrap sidebar-panel sidebar-panel-active">
        <div class="site-overview">

          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
  
  <p class="site-author-name" itemprop="name">Wen Wu</p>
  <div class="site-description motion-element" itemprop="description">I'm a bluetooth Host and Controller developer</div>
</div>


  <nav class="site-state motion-element">
    
      <div class="site-state-item site-state-posts">
        
          <a href="/archives/">
        
          <span class="site-state-item-count">80</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/categories/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">16</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    

    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/tags/">
          
        
        
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
          
        
        <span class="site-state-item-count">39</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>













          
          
        </div>
      </div>

      

      

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">Wen Wu</span>

  

  
</div>


  <div class="powered-by">由 <a href="https://hexo.io" class="theme-link" rel="noopener" target="_blank">Hexo</a> 强力驱动 v3.9.0</div>



  <span class="post-meta-divider">|</span>



  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> v7.2.0</div>





  <script src="https://unpkg.com/mermaid@/dist/mermaid.min.js"></script>
  <script>
    if (window.mermaid) {
      mermaid.initialize("");
    }
  </script>



        








        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

    

    

  </div>

  

<script>
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>
















  
  









  
  <script src="/lib/jquery/index.js?v=3.4.1"></script>

  
  <script src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>




  <script src="/js/utils.js?v=7.2.0"></script>

  <script src="/js/motion.js?v=7.2.0"></script>



  
  


  <script src="/js/affix.js?v=7.2.0"></script>

  <script src="/js/schemes/pisces.js?v=7.2.0"></script>




  
  <script src="/js/scrollspy.js?v=7.2.0"></script>
<script src="/js/post-details.js?v=7.2.0"></script>



  <script src="/js/next-boot.js?v=7.2.0"></script>

  

  

  


  
  

  
  

  























<script>
if ($('body').find('pre.mermaid').length) {
  $.ajax({
    type: 'GET',
    url: '//cdn.jsdelivr.net/npm/mermaid@8/dist/mermaid.min.js',
    dataType: 'script',
    cache: true,
    success: function() {
      mermaid.initialize({
        theme: 'forest',
        logLevel: 3,
        flowchart: { curve: 'linear' },
        gantt: { axisFormat: '%m/%d/%Y' },
        sequence: { actorMargin: 50 }
      });
    }
  });
}
</script>


<script>
// GET RESPONSIVE HEIGHT PASSED FROM IFRAME

window.addEventListener("message", function(e) {
  var data = e.data;
  if ((typeof data === 'string') && (data.indexOf('ciu_embed') > -1)) {
    var featureID = data.split(':')[1];
    var height = data.split(':')[2];
    $(`iframe[data-feature=${featureID}]`).height(parseInt(height) + 30);
  }
}, false);
</script>








  
    

  

<script src="//cdn.jsdelivr.net/npm/valine@1/dist/Valine.min.js"></script>

<script>
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(function(item) {
    return GUEST.indexOf(item) > -1;
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'wteo2C9GdG6F2N92cktVar8K-gzGzoHsz',
    appKey: 'IBKrtkUwlKqPJ8FQsKkNP0K1',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: true,
    lang: 'zh-cn' || 'zh-cn'
  });
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({"tex2jax":{"inlineMath":[["$","$"],["\\(","\\)"]],"skipTags":["script","noscript","style","textarea","pre","code"],"processEscapes":true},"TeX":{"equationNumbers":{"autoNumber":"AMS"}}});
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

  

</body>
</html>
